{extend name="layout:default" /}
{block name="title"}修改{/block}
{block name="content"}
<div class="box box-default">
    <div class="box-header with-border">
        <h3 class="box-title">修改课程</h3>
    </div>
    <!-- /.box-header -->
    <div class="box-body">
            <a href="{:url('index')}" class="btn btn-info">返回</a>

        <form class="form-horizontal" method="post" enctype="multipart/form-data">
            <div class="form-group">
                <label class="col-sm-2 control-label">课程名称</label>
                <div class="col-sm-8">
                    <input type="text" class="form-control" value="{$article.title}" name="title" placeholder="课程名称">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">排序</label>
                <div class="col-sm-8">
                    <input type="text" class="form-control" value="{$article.sort}" name="sort" placeholder="排序">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">描述</label>
                <div class="col-sm-8">
                    <input type="text" class="form-control" value="{$article.introduction}" name="introduction" placeholder="描述">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">文章内容</label>
                <div class="col-sm-8">
                    <textarea name="text" cols="150" rows="7">{$article.text}</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">是否热门</label>
                <div class="col-sm-10" >
                    <input type="radio" value="1" name="is_hot" {$article.is_hot ===1 ? 'checked':''}>是
                    <input type="radio" value="2" name="is_hot" {$article.is_hot ===1 ? '':'checked'}>否
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">是否最新</label>
                <div class="col-sm-10" >
                    <input type="radio" value="1" name="is_new" {$article.is_new ===1 ? 'checked':''}>是
                    <input type="radio" value="2" name="is_new" {$article.is_new ===1 ? '':'checked'}>否
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">是否放置主页</label>
                <div class="col-sm-10" >
                    <input type="radio" value="1" name="is_home" {$article.is_home ===1 ? 'checked':''}>是
                    <input type="radio" value="2" name="is_home" {$article.is_home ===1 ? '':'checked'}>否
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">状态</label>
                <div class="col-sm-10">
                    <input type="radio"  value="1" name="status" {$article.status ===1 ? 'checked':''} >正常
                    <input type="radio"  value="2" name="status" {$article.status ===1 ? '':'checked'}>禁用
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">所属分类</label>
                <div class="col-sm-8">
                    <select name="category_id" class="form-control">
                        {volist name="categories" id="vo"}
                        <option value="{$vo.id}" {$vo.id === $article.category_id ? 'selected' : '' }>{$vo.name}</option>
                        {/volist}
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">所属类别</label>
                <div class="col-sm-8">
                        {volist name="class" id="vo1"}
                        <label class="checkbox-inline">
                            <input type="checkbox" name="class_ids[]" value="{$vo1.id}" {if in_array($vo1.id,$article.class_ids) } checked {/if}> {$vo1.name}
                        </label>
                        {/volist}
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label">课程图片</label>
                <div class="col-sm-8">
                    <img src="{$article.thumb}" alt="" width="200">
                    <input type="file" name="image">
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-4">
                    <button type="submit" class="btn btn-info pull-right">提交</button>
                </div>
            </div>
        </form>
    </div>
    <!-- /.box-body -->
</div>
{/block}
